<template>
  <div>
    <crumb />
    <div class="main-contianer3 resource-manage">
      <div class="top-content">
        <SelectCourseClass class="top-select" />
        <div class="top-tabs flex-row">
          <ul class="tabs flex-row">
            <li :class="['tab', { 'active': tabId == 1 }]" @click="changeTab(1)">我的资源</li>
            <li :class="['tab', { 'active': tabId == 2 }]" @click="changeTab(2)">共享资源</li>
            <li :class="['tab', { 'active': tabId == 3 }]" @click="changeTab(3)">资源库</li>
          </ul>
        </div>
      </div>
      <myResource resource-type="my" v-if="tabId === 1" />
      <shareResource resource-type="share" v-if="tabId === 2" />
      <ResourceLibrary :school-id="schoolId" v-if="tabId === 3" />
     </div>
  </div>
</template>

<script>
import SelectCourseClass from '@/components/SelectCourseClass'
import ResourceLibrary from './ResourceLibrary'
import ResourceList from './ResourceList'
import { mapGetters } from 'vuex'

export default {
  name: 'index',
  data () {
    return {
      tabId: 1,
      schoolId: null,
      value: true,
      options: [{
        value: '选项1',
        label: '黄金糕'
      }, {
        value: '选项2',
        label: '双皮奶'
      }, {
        value: '选项3',
        label: '蚵仔煎'
      }, {
        value: '选项4',
        label: '龙须面'
      }, {
        value: '选项5',
        label: '北京烤鸭'
      }]
    }
  },
  computed: {
    ...mapGetters([
      'loginInfo'
    ])
  },
  components: {
    SelectCourseClass,
    ResourceLibrary,
    myResource: ResourceList,
    shareResource: ResourceList
  },
  mounted () {
  },
  methods: {
    changeTab (tab) {
      this.tabId = tab
    }
  }
}
</script>
<style scoped lang="scss">
.resource-manage {
  .top-content {
    width: 100%;
    background: #fff;
    .top-select {
      padding: 20px;
    }
    .top-tabs {
      height: 50px;
      width: 100%;
      padding: 20px 20px 20px 0;
      .tabs {
        width: 100%;
        height: 60px;
        justify-content: flex-start;
        .tab {
          width: 133px;
          text-align: center;
          font-size: 20px;
          height: 50px;
          line-height: 50px;
          color: #101d37;
          cursor: pointer;
          &.active {
            color: #fff;
            background: #009CF6;
          }
        }
      }
    }
  }
}
</style>
